package com.xinqi.modules.prepare.courseware.manager;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.service.BaseService;
import com.xinqi.modules.prepare.courseware.domain.PrepareCoursewareEntity;
import com.xinqi.modules.prepare.courseware.domain.PrepareCoursewarePartEntity;
import com.xinqi.modules.prepare.courseware.dto.req.PrepareCoursewarePartQueryDTO;
import com.xinqi.modules.prepare.courseware.dto.rsp.PrepareCoursewarePartResultDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 备课区互动课件切片管理层
 *
 * @author: system
 * @date: 2023/03/19
 */
public interface PrepareCoursewarePartManager extends BaseService<PrepareCoursewarePartEntity> {

    /**
     * 自定义分页查询
     */
    Page<PrepareCoursewarePartResultDTO> findPage(Page<Object> page, PrepareCoursewarePartQueryDTO query);

    /**
     * 自定义列表查询
     */
    List<PrepareCoursewarePartResultDTO> findList(PrepareCoursewarePartQueryDTO query);

    /**
     * 根据id查询 备课区互动课件切片数据
     */
    PrepareCoursewarePartEntity findById(Long id);

    /**
     * 根据id删除 备课区互动课件切片数据
     */
    @Transactional(rollbackFor = Exception.class)
    boolean deleteById(Long id);

    List<PrepareCoursewarePartEntity> findByCoursewareId(Long coursewareId);

    @Transactional(rollbackFor = Exception.class)
    Boolean deleteByCoursewareId(Long coursewareId);

    @Transactional(rollbackFor = Exception.class)
    void copy(PrepareCoursewareEntity source, PrepareCoursewareEntity target);

    @Transactional(rollbackFor = Exception.class)
    void move(PrepareCoursewareEntity entity);
}
